<?php

use Cekurte\Model,
	Cekurte\App;

class Application_Model_Task extends Model
{
	protected function setup()
	{
		$this->entity 	= 'Task';
		$this->form 	= App::getForm('Task');
	}
	
	public function save( array $data, $id = null )
	{
		if( $this->form->isValid( $data ) )
		{
			return parent::save( $data, $id );
		}
		
		return false;
	}
	
	public function getAll()
	{
		return $this->find( 
			array( 'id', 'name' ), array(), array( 'name' => Model::ORDER_BY_ASC )
		);
	}
}